Ponder.registry((event) => {
    event.create("eou:oil_fired_generator/controller").scene("oil_fired_generator", "建造燃油引擎的过程", (scene, util) => {
        scene.showStructure()
        let showCustomMachine = (pos, block, use_particle) => {
            scene.world.setBlocks(pos, use_particle, "custommachinery:custom_machine_block");
            scene.world.modifyBlockEntityNBT(pos, nbt => {
                nbt.machineID = block
            })
        }
        showCustomMachine([0, 1, 0], "eou:oil_fired_generator/controller", true)
        showCustomMachine([1, 1, 0], "eou:oil_fired_generator/stress_port", true);
        scene.text(60, "你需要这些方块建造燃油引擎", [1.5, 1.5, 0])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(80);
        scene.text(80, "注意控制器，应力口，只有带特殊颜色的面可以进行自动化。", [1.5, 1.5, 0])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(100);

        scene.world.setBlocks([0, 1, 0, 2, 2, 0], true, "minecraft:air")
        scene.idle(10)

        showCustomMachine([2, 1, 1], "eou:oil_fired_generator/controller", true)
        scene.text(40, "先放置一个控制器", [2.5, 1.5, 1.5])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(60)

        showCustomMachine([2, 1, 2], "eou:oil_fired_generator/stress_port", true)
        scene.text(40, "在控制器的后面放置应力口", [2.5, 1.5, 3.5])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(60)

        scene.world.modifyBlock([2, 1, 2], (curState) => curState.with("facing", "south"), true);
        scene.text(40, "记得把应力口的方向调整的特殊颜色向外，燃油引擎搭建完成", [2.5, 1.5, 2.5])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(60)

        scene.text(60, "如果燃油引擎正常，但是不工作，请尝试重新放置一下控制器。", [2.5, 1.5, 1.5])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
        scene.idle(80)
        scene.text(60, "记得保持控制器里面的燃料充足，否则燃油引擎不会开始工作", [2.5, 1.5, 1.5])
            .colored(PonderPalette.RED)
            .placeNearTarget()
            .attachKeyFrame();
    });
});